/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package uimigration.Interactions.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

import uimigration.Interactions.*;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class InteractionsFactoryImpl extends EFactoryImpl implements
		InteractionsFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static InteractionsFactory init() {
		try {
			InteractionsFactory theInteractionsFactory = (InteractionsFactory)EPackage.Registry.INSTANCE.getEFactory("http://interactions/1.0"); 
			if (theInteractionsFactory != null) {
				return theInteractionsFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new InteractionsFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public InteractionsFactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case InteractionsPackage.ACTIVATE: return createActivate();
			case InteractionsPackage.MOVE_DEVICE: return createMoveDevice();
			case InteractionsPackage.ENTER_DATA: return createEnterData();
			case InteractionsPackage.WIDGET: return createWidget();
			case InteractionsPackage.CONTENT: return createContent();
			case InteractionsPackage.DATA_TYPE: return createDataType();
			case InteractionsPackage.PATH: return createPath();
			case InteractionsPackage.SELECT_CONTENT: return createSelectContent();
			case InteractionsPackage.SELECT_WIDGET: return createSelectWidget();
			case InteractionsPackage.ACTIVATE_TASK: return createActivateTask();
			case InteractionsPackage.ACTIVATE_WIDGET: return createActivateWidget();
			case InteractionsPackage.EDIT_CONTENT: return createEditContent();
			case InteractionsPackage.RESIZE: return createResize();
			case InteractionsPackage.ACTIVATE_NAVIGATION: return createActivateNavigation();
			case InteractionsPackage.MOVE_WIDGET: return createMoveWidget();
			case InteractionsPackage.TRANSLATE: return createTranslate();
			case InteractionsPackage.ROTATE: return createRotate();
			case InteractionsPackage.DISPLAY_VALUE: return createDisplayValue();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object createFromString(EDataType eDataType, String initialValue) {
		switch (eDataType.getClassifierID()) {
			case InteractionsPackage.LAYOUT:
				return createLayoutFromString(eDataType, initialValue);
			case InteractionsPackage.DIMENSIONS:
				return createDimensionsFromString(eDataType, initialValue);
			case InteractionsPackage.TYPE:
				return createTypeFromString(eDataType, initialValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String convertToString(EDataType eDataType, Object instanceValue) {
		switch (eDataType.getClassifierID()) {
			case InteractionsPackage.LAYOUT:
				return convertLayoutToString(eDataType, instanceValue);
			case InteractionsPackage.DIMENSIONS:
				return convertDimensionsToString(eDataType, instanceValue);
			case InteractionsPackage.TYPE:
				return convertTypeToString(eDataType, instanceValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Activate createActivate() {
		ActivateImpl activate = new ActivateImpl();
		return activate;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MoveDevice createMoveDevice() {
		MoveDeviceImpl moveDevice = new MoveDeviceImpl();
		return moveDevice;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EnterData createEnterData() {
		EnterDataImpl enterData = new EnterDataImpl();
		return enterData;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Widget createWidget() {
		WidgetImpl widget = new WidgetImpl();
		return widget;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Content createContent() {
		ContentImpl content = new ContentImpl();
		return content;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataType createDataType() {
		DataTypeImpl dataType = new DataTypeImpl();
		return dataType;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Path createPath() {
		PathImpl path = new PathImpl();
		return path;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SelectContent createSelectContent() {
		SelectContentImpl selectContent = new SelectContentImpl();
		return selectContent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SelectWidget createSelectWidget() {
		SelectWidgetImpl selectWidget = new SelectWidgetImpl();
		return selectWidget;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ActivateTask createActivateTask() {
		ActivateTaskImpl activateTask = new ActivateTaskImpl();
		return activateTask;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ActivateWidget createActivateWidget() {
		ActivateWidgetImpl activateWidget = new ActivateWidgetImpl();
		return activateWidget;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EditContent createEditContent() {
		EditContentImpl editContent = new EditContentImpl();
		return editContent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Resize createResize() {
		ResizeImpl resize = new ResizeImpl();
		return resize;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ActivateNavigation createActivateNavigation() {
		ActivateNavigationImpl activateNavigation = new ActivateNavigationImpl();
		return activateNavigation;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MoveWidget createMoveWidget() {
		MoveWidgetImpl moveWidget = new MoveWidgetImpl();
		return moveWidget;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Translate createTranslate() {
		TranslateImpl translate = new TranslateImpl();
		return translate;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Rotate createRotate() {
		RotateImpl rotate = new RotateImpl();
		return rotate;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DisplayValue createDisplayValue() {
		DisplayValueImpl displayValue = new DisplayValueImpl();
		return displayValue;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Layout createLayoutFromString(EDataType eDataType,
			String initialValue) {
		Layout result = Layout.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertLayoutToString(EDataType eDataType,
			Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Dimensions createDimensionsFromString(EDataType eDataType,
			String initialValue) {
		Dimensions result = Dimensions.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertDimensionsToString(EDataType eDataType,
			Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Type createTypeFromString(EDataType eDataType, String initialValue) {
		Type result = Type.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertTypeToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public InteractionsPackage getInteractionsPackage() {
		return (InteractionsPackage)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static InteractionsPackage getPackage() {
		return InteractionsPackage.eINSTANCE;
	}

} //InteractionsFactoryImpl
